import {request}  from 'umi';
// 加载数据
export async function loadPassengerInfo(){
    return request(`/api/admin/passenger-info`)
}
// 新增数据
export async function saveOne(data:any){
    return request(`/api/admin/passenger-info`,{
        method:"POST",
        data
    })
    
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });
}
// 修改数据
export async function updateOne(id:any,data:any){
    return request(`/api/admin/passenger-info/${id}`,{
        method:"PUT",
        data
    })
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });
}
//删除数据
export function deleteOne(id:number){
    return request(`/api/admin/passenger-info/${id}`,{
        method:"DELETE",
    })
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });
}
//查找数据
export function selectAirline(data:any){
    return request(`/api/admin/passenger-info/search-airline`,{
        method:"POST",
        data
    })
    .then(function(response) {
      console.log("&&",response);
      return response;
    })
    .catch(function(error) {
      console.log(error);
    });
}
